//
//  JSMStrategyCollectionViewCell.m
//  TakeYouTourTogether
//
//  Created by king on 15/12/5.
//  Copyright © 2015年 king. All rights reserved.
//

#import "JSMStrategyCollectionViewCell.h"

@implementation JSMStrategyCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createStrategyCollectionViewCell];
    }
    return self;
}

- (void)createStrategyCollectionViewCell {
    self.myImageView = [[BaseImageView alloc] init];
    [self.contentView addSubview:self.myImageView];
    self.myImageView.backgroundColor = [UIColor clearColor];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.myImageView.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
}

- (void)setDataModel:(JSMStrategyModel *)dataModel {
    if (_dataModel != dataModel) {
        _dataModel = dataModel;
    }
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:dataModel.cover_s] placeholderImage:[UIImage imageNamed:PLACE_HOLDER_IMAGE]];
}

@end
